# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

_pkgname=sphinxcontrib-mermaid
pkgname=sphinx-$_pkgname
pkgver=0.3.1
pkgrel=1
pkgdesc='Mermaid diagrams in yours sphinx powered docs'
arch=('any')
url='https://github.com/mgaitan/sphinxcontrib-mermaid'
license=('BSD')
depends=('python-sphinx')
makedepends=('python-setuptools' "$pkgname")
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('ed9da58bfeff1dace9bcf6fe58355a84419d72304a5e3232939517a41a764e2e8587a8e281da06075d2719c5d709474ca74f7c7cf498360d88c55d613e58a303')

build() {
  cd $_pkgname-$pkgver

  python setup.py build

  cd docs

  make html
}

package() {
  cd $_pkgname-$pkgver

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -Dm 644 LICENSE.rst "$pkgdir"/usr/share/licenses/$pkgname/LICENSE

  install -dm 755 "$pkgdir"/usr/share/doc/$pkgname
  cp -r -a --no-preserve=ownership docs/_build/html "$pkgdir"/usr/share/doc/$pkgname
}

# vim:set ts=2 sw=2 et:
